package com.futvan.z.system.zinstallfiles;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

import org.springframework.stereotype.Service;

import com.futvan.z.framework.common.bean.Code;
import com.futvan.z.framework.common.bean.Result;
import com.futvan.z.framework.core.SuperService;
import com.futvan.z.framework.core.z;
import com.futvan.z.framework.util.JsonUtil;
import com.futvan.z.framework.util.StringUtil;
@Service
public class ZinstallfilesService extends SuperService{

	/**
	 * 获取最新的Z平台运行包信息
	 * @return
	 */
	public Result getNewZ(String FileType) {
		Result result = new Result();
		if(z.isNotNull(FileType)) {
			String sql = "SELECT * FROM z_installfiles c WHERE c.install_files = '"+FileType+"' AND c.isrelease = '1' ORDER BY c.create_time DESC  LIMIT 0,1";
			z_installfiles newZfile =  sqlSession.selectOne("z_installfiles_select_sql", sql);
			if(z.isNotNull(newZfile)) {
				result.setCode(Code.SUCCESS);
				result.setData(newZfile);
			}else {
				result.setCode(Code.ERROR);
				result.setMsg("当前未发布程序包");
			}
		}else {
			result.setCode(Code.ERROR);
			result.setMsg("FileType is null|文件类型不可为空");
		}
		return result;
	}
}
